<?php
include('config.php');
$uname=$_POST['uname'];
$upass=$_POST['upass'];
$sql="SELECT * FROM userdata WHERE name='$uname' AND password='$upass'";		
$sqlquery=mysql_db_query($dbname,$sql);
$num_rows = mysql_num_rows($sqlquery);
if($num_rows==1){
	echo "n";
}
else{
	$sql="INSERT INTO userdata (name,password) VALUES('$uname','$upass')";		
	$sqlquery=mysql_db_query($dbname,$sql);
	echo "y";
}

mysql_close();
?>
